import { Dispatch } from 'redux'
import axios from 'axios'
export const SET_LIST = 'SET_LIST';

export function set_list() {
	// 异步acion redux-thnuk
	return async (dispatch: Dispatch) => {
		const resp = await axios.get('/api/list')
		dispatch({ type: SET_LIST, payload: resp.data.data })
	}
}